#include "DeviceStub.h"
#include "TimeManager.h"

namespace sol9
{
namespace device
{

	__implementBaseClass(IDevice);
	__implementClass(DeviceStub, IDevice);
	
	DeviceStub::DeviceStub(const SDeviceParameters& Params)
		: m_Parameters(Params), m_bClose(false), m_pEventReceiver(nullptr)
	{
		util::TimeManager::initialize();
	}

	DeviceStub::~DeviceStub()
	{
	}

	bool DeviceStub::run()
	{
		util::TimeManager::tickTimers();
		return true;
	}

	void DeviceStub::close()
	{
	}

	bool DeviceStub::postEventFromUser(const SEvent& event)
	{
		if (m_pEventReceiver)
			return m_pEventReceiver->OnEvent(event);

		return false;
	}

	void DeviceStub::setEventReceiver(IEventReceiver* pReceiver)
	{
		m_pEventReceiver = pReceiver;
	}

	IEventReceiver* DeviceStub::getEventReceiver()
	{
		return m_pEventReceiver;
	}

	bool DeviceStub::isFullscreen() const
	{
		return m_Parameters.bFullscreen;
	}

	eDeviceTypes DeviceStub::getType() const
	{
		return EDT_Unknown;
	}

} // namespace device
} // namespace sol9